package edu.sctu.xiangkun.day201505.day20150526.textthree;

/**
 * Created by lenovo on 2015/5/25.
 */
public class StringDemo {

    public int stringLength( String str){
        int count = str.length();
        return count;
    }

    public int stringLengthTwo(){
        String str = "hello world";
        int count = str.length();
        return count;
    }

    public String stringTrim(String str){
        String string = str.trim();
        return string;
    }

    public boolean stringStartsWith(){
        String str = "hello world";
        boolean string = str.startsWith("o", 4);
        return string;
    }

    public boolean stringEndsWith(String str){
        boolean string = str.endsWith("d");
        return string;
    }

    public boolean stringEquals(String str){
        boolean string = str.equals("hello reader");
        return string;
    }

    public boolean stringEqualsIgnoreCase(String str){
        boolean string = str.equalsIgnoreCase("hello reader");
        return string;
    }

    public String stringToLowerCase(String str){
        String string = str.toLowerCase();
        return string;
    }

    public String stringToUpperCase(String str){
        String string = str.toUpperCase();
        return string;
    }

    public int stringIndex(String str){
        int count = str.indexOf("e",0);
        return count;
    }

    public char stringCharAt(String str){
        char string = str.charAt(3);
        return string;
    }

    public String stringReplaceAll(String str){
        String string = str.replaceAll("world","Bob");
        return string;
    }
}
